package org.xiaoyu.rpc.proxy.support;

import lombok.extern.slf4j.Slf4j;
import org.xiaoyu.rpc.Invoker;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created By Have
 * 2021/7/12 16:50
 */
@Slf4j
public class InvokerInvocationHandler implements InvocationHandler {
    private final Invoker<?> invoker;

    public InvokerInvocationHandler(Invoker<?> invoker) {
        this.invoker = invoker;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object value = method.invoke(proxy, args);
        return value;
    }
}
